<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>

    <link href="../../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="../../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="../../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="../../assets/custom/css/iconfont.css"/>

    <link href="../../assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
    <link href="../../assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="../../assets/global/plugins/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" type="text/css" />

    <link href="../../assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
    <link href="../../assets/global/css/plugins.min.css" rel="stylesheet"  type="text/css" />

    <link rel="stylesheet" href="../../assets/global/plugins/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/custom/css/changeother.css"/>
    <style>
        .defaultBox {
            background: #fff;
            position: absolute;
            width: 600px;
            z-index: 10;
            box-shadow: 0 2px 4px rgba(0,0,0,.23);
        }
        .percent50 {
            width: 50%;
            float: left;
            padding: 0 5px;
        }
        .percent25 {
            width: 25%;
            float: left;
            padding: 0 5px;
        }
        .percent13 {
            width: 13%;
            float: left;
            padding: 0 5px;
        }
    </style>
</head>
<body>
<div class="portlet-body">
    <div class="form-body">
        <div class="form-group" >
            <span class="col-xs-2 form-label"><font class="formRequired">*</font>数据对象名:</span>
            <div class="col-xs-10">
                <input type="text">
            </div>
        </div>
        <div class="clearfix" >
            <span class="col-xs-2 form-label">URL:</span>
            <div class="col-xs-3">
                <select class="bs-select form-control">
                    <option>GET</option>
                    <option>POST</option>
                    <option>PUT</option>
                    <option>DELETE</option>
                    <option>HEAD</option>
                    <option>OPTIONS</option>
                    <option>PATCH</option>
                </select>
            </div>
            <div class="col-xs-3">
                <select class="bs-select form-control">
                    <option>无</option>
                    <option>海康威视R8700</option>
                    <option>万维易源</option>
                </select>
            </div>
            <div class="col-xs-4">
                <input type="text" class="widthFull">
            </div>
        </div>
        <div class="form-group" >
            <span class="col-xs-offset-2 col-xs-9 label_on">http://route.showapi.com/9-5</span>
        </div>
        <div class="clearfix" >
            <div class="col-xs-2">
                <div class="mt-checkbox-inline fr">
                    <label class="mt-checkbox mt-checkbox-outline">
                        <input type="checkbox" value="" checked="checked"><h3 class="sub" style="line-height: initial">分页查询</h3>
                        <span></span>
                    </label>
                </div>
            </div>

        </div>

        <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <span class="col-xs-4  form-label">每页记录数-参数名:</span>
                    <div class="col-xs-8 ">
                        <select class="bs-select form-control">
                            <option>无</option>
                            <option>海康威视R8700</option>
                            <option>万维易源</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                       <span class="col-xs-4  form-label">第几页-参数名:</span>
                       <div class="col-xs-8 ">
                           <select class="bs-select form-control">
                               <option>无</option>
                               <option>海康威视R8700</option>
                               <option>万维易源</option>
                           </select>
                       </div>
                   </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <span class="col-xs-4  form-label">分页方法:</span>
                    <div class="col-xs-8">
                        <select class="bs-select form-control">
                            <option>无</option>
                            <option>海康威视R8700</option>
                            <option>万维易源</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <span class="col-xs-4  form-label">最大页数-字段名:</span>
                    <div class="col-xs-8 ">
                        <select class="bs-select form-control">
                            <option>无</option>
                            <option>海康威视R8700</option>
                            <option>万维易源</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class="layui-this">Body</li>
                <li>Headers</li>
                <li>Parameters</li>
                <li>认证</li>
                <li>输出</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="clearfix margin-top-10" >
                        <span class="fl label_on">Application Type:</span>
                        <div class="col-xs-4">
                            <select class="bs-select form-control">
                                <option>JSON</option>
                                <option>FORM URLENCODED</option>
                                <option>XML</option>
                                <option>OCTET STREAM</option>
                            </select>
                        </div>
                    </div>
                    <div class="from_control">
                        <div class="from_control_r">
                            <button class="btn blue-hoki">排序</button>
                            <button class="btn default">添加</button>
                        </div>
                    </div>
                    <table class="layui-table layui-table-view">
                        <colgroup>
                            <col width="150">
                            <col width="200">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>参数名</th>
                            <th>值</th>
                            <th>描述</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>showapi_timestamp</td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>showapi_timestamp</td>
                        </tr>
                        <tr>
                            <td>showapi_appid</td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>showapi_appid</td>
                        </tr>
                        <tr>
                            <td>showapi_sign</td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>showapi_sign</td>
                        </tr>
                        <tr>
                            <td>showapi_res_gzip</td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>showapi_res_gzip</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-tab-item">
                    <div class="from_control">
                        <div class="from_control_r">
                            <button class="btn blue-hoki">排序</button>
                            <button class="btn default">添加</button>
                        </div>
                    </div>
                    <table class="layui-table layui-table-view">
                        <colgroup>
                            <col width="150">
                            <col width="200">
                            <col width="150">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>参数</th>
                            <th>值</th>
                            <th>描述</th>
                            <th>删除</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>showapi_timestamp</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>showapi_appid</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>showapi_sign</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>showapi_res_gzip</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-tab-item">
                    <div class="from_control">
                        <div class="from_control_r">
                            <button class="btn blue-hoki">排序</button>
                            <button class="btn default">添加</button>
                        </div>
                    </div>
                    <table class="layui-table layui-table-view">
                        <colgroup>
                            <col width="150">
                            <col width="200">
                            <col width="150">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>参数</th>
                            <th>值</th>
                            <th>描述</th>
                            <th>删除</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>showapi_timestamp</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>showapi_appid</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>showapi_sign</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>showapi_res_gzip</td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">String</option>
                                    <option value="OUT">Number</option>
                                    <option value="INOUT">byte[]</option>
                                </select>
                            </td>
                            <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                            <td>
                                <select class="bs-select form-control" >
                                    <option value="IN">Parameters</option>
                                    <option value="OUT">Body</option>
                                    <option value="INOUT">Headers</option>
                                </select>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-tab-item">
                    认证
                </div>
                <div class="layui-tab-item">
                    <div class="clearfix margin-top-10">
                        <span class="fl label_on">返回格式:</span>
                        <div class="col-xs-3">
                            <select class="bs-select form-control">
                                <option>JSON</option>
                                <option>XML</option>
                            </select>
                        </div>
                        <div class="col-xs-3">
                            <div class="mt-checkbox-inline">
                                <label class="mt-checkbox mt-checkbox-outline">
                                    <input type="checkbox" value="" checked="checked" class="resolveTable"> 解析二维表数据
                                    <span></span>
                                </label>
                            </div>

                        </div>
                    </div>
                    <div class="resolveTableData">
                        <div class="from_control">
                            <div class="from_control_r">
                                <button class="btn blue-hoki">从示例数据导入</button>
                                <button class="btn default">添加</button>
                            </div>
                        </div>
                        <table class="layui-table layui-table-view">
                            <colgroup>
                                <col width="150">
                                <col width="200">
                                <col width="150">
                                <col>
                            </colgroup>
                            <thead>
                            <tr>
                                <th>参数</th>
                                <th>值</th>
                                <th>描述</th>
                                <th>删除</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>showapi_timestamp</td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">String</option>
                                        <option value="OUT">Number</option>
                                        <option value="INOUT">byte[]</option>
                                    </select>
                                </td>
                                <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">Parameters</option>
                                        <option value="OUT">Body</option>
                                        <option value="INOUT">Headers</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>showapi_appid</td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">String</option>
                                        <option value="OUT">Number</option>
                                        <option value="INOUT">byte[]</option>
                                    </select>
                                </td>
                                <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">Parameters</option>
                                        <option value="OUT">Body</option>
                                        <option value="INOUT">Headers</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>showapi_sign</td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">String</option>
                                        <option value="OUT">Number</option>
                                        <option value="INOUT">byte[]</option>
                                    </select>
                                </td>
                                <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">Parameters</option>
                                        <option value="OUT">Body</option>
                                        <option value="INOUT">Headers</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>showapi_res_gzip</td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">String</option>
                                        <option value="OUT">Number</option>
                                        <option value="INOUT">byte[]</option>
                                    </select>
                                </td>
                                <td><a class="tableHref" href="javascript:;">人生就像是一场修行</a></td>
                                <td>
                                    <select class="bs-select form-control" >
                                        <option value="IN">Parameters</option>
                                        <option value="OUT">Body</option>
                                        <option value="INOUT">Headers</option>
                                    </select>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="../../assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/bootstrap-select/js/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/jquery-multi-select/js/jquery.multi-select.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>


<script src="../../assets/global/scripts/app.min.js" type="text/javascript"></script>
<script src="../../assets/pages/scripts/components-select2.min.js" type="text/javascript"></script>

<script src="../../assets/pages/scripts/components-multi-select.min.js" type="text/javascript"></script>
<script src="../../assets/global/plugins/layui/layui.all.js"></script>
<script>
    //解析二维表数据
    $(".resolveTable").change(function () {
        if($(this).prop("checked")){
            $(".resolveTableData").removeClass("display_none");
        }else {
            $(".resolveTableData").addClass("display_none");
        }
    });

    //点击Body分页中值
    $("td .tableHref").click(function (event) {
        //删除box
        $('.defaultBox').remove();
        //如果没有打开box
        if(!$(this).hasClass("open")){

            $(this).addClass("open");

            var left = $(this).offset().left - 180 + "px";
            var top = $(this).offset().top - 180 + "px";

            var defaultBoxString = "<div style='left: "+left+";top: "+top+";' class=\"defaultBox\">\n" +
                "    <div class=\"form-body\">\n" +
                "        <div class=\"form-group\">\n" +
                "            <div class=\"percent25\">\n" +
                "                <select class=\"bs-select form-control toggleType\">\n" +
                "                    <option>系统变量</option>\n" +
                "                    <option>常量</option>\n" +
                "                </select>\n" +
                "            </div>\n" +
                "        </div>\n" +
                "        <div class=\"form-group defaultVariable\">\n" +
                "            <div class=\"percent25\">\n" +
                "                <select class=\"bs-select form-control toggleClient\">\n" +
                "                    <option>clientId</option>\n" +
                "                    <option>clientSecrct</option>\n" +
                "                    <option>clientTime(当前时间)</option>\n" +
                "                    <option>generateDefaultSign(数字签名)</option>\n" +
                "                </select>\n" +
                "            </div>\n" +
                "            <div class=\"currentTime\">\n" +
                "                <div class=\"percent13\">\n" +
                "                    <select class=\"bs-select form-control\">\n" +
                "                        <option>+</option>\n" +
                "                        <option>-</option>\n" +
                "                    </select>\n" +
                "                </div>\n" +
                "                <div class=\"percent13\">\n" +
                "                    <input type=\"text\">\n" +
                "                </div>\n" +
                "                <div class=\"percent13\">\n" +
                "                    <select class=\"bs-select form-control\">\n" +
                "                        <option>年</option>\n" +
                "                        <option>月</option>\n" +
                "                        <option>日</option>\n" +
                "                        <option>小时</option>\n" +
                "                        <option>分</option>\n" +
                "                    </select>\n" +
                "                </div>\n" +
                "                <span class=\"fl label_on\">格式:</span>\n" +
                "                <div class=\"percent25\">\n" +
                "                    <select class=\"bs-select form-control\">\n" +
                "                        <option>毫秒数(LongTime)</option>\n" +
                "                        <option>YYYY-MM-dd</option>\n" +
                "                    </select>\n" +
                "                </div>\n" +
                "            </div>\n" +
                "\n" +
                "        </div>\n" +
                "        <div class=\"form-group display_none defaultConstant\">\n" +
                "            <div class=\"percent50\">\n" +
                "                <input type=\"text\">\n" +
                "            </div>\n" +
                "        </div>\n" +
                "        <div class=\"form-group-last clearfix\">\n" +
                "            <div class=\"fr\">\n" +
                "                <button class=\"btn blue-hoki defaultBoxConfirm\">确认</button>\n" +
                "                <button class=\"btn default defaultBoxCancel\">取消</button>\n" +
                "            </div>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "</div>";

            //加载到dom
            $(document.body).append(defaultBoxString);
            $('.bs-select').selectpicker();

            //点击确认
            $(".defaultBoxConfirm").click(function () {
                console.log("确认");
                return false;
            });


            //点击取消
            $(".defaultBoxCancel").click(function () {
                $('.defaultBox').remove();
                $(".open").removeClass("open");
                return false;
            });

            //切换常量和系统变量
            $('.toggleType').on('changed.bs.select', function (e, clickedIndex) {

                if(clickedIndex === 0){
                    $(".defaultVariable").removeClass("display_none");
                    $(".defaultConstant").addClass("display_none");
                }else if(clickedIndex === 1){
                    $(".defaultVariable").addClass("display_none");
                    $(".defaultConstant").removeClass("display_none");
                }
                return false;
            });

            //切换client
            $('.toggleClient').on('changed.bs.select', function (e, clickedIndex) {

                if(clickedIndex === 2){
                    $(".currentTime").removeClass("display_none");
                }else {
                    $(".currentTime").addClass("display_none");
                }
                return false;
            });

        }else {
            $(this).removeClass("open");
        }

    });


</script>
</html>